﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="acpPesqEmail.aspx.cs" Inherits="Protegidos_Administracao_Cadastros__popup_acpPesqEmail" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Register TagPrefix="uc1" TagName="HeadTag"  Src="~/_includes/HeadTag.ascx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <!-- Includes -->
    <uc1:HeadTag ID="HeadTag1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <script type="text/javascript">
            function CloseAndRebind(args)
            {
                GetRadWindow().Close();
                GetRadWindow().BrowserWindow.refreshGrid(args);
            }
    		
            function GetRadWindow()
            {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well)
    				
                return oWindow;
            }

            function CancelEdit()
            {
                GetRadWindow().Close();		
            }
        </script>
        
        <table width="99%" align="right">
            <tr>
                <td>
                    <div class="SuTituloVR">Pesquisar Email</div>
                </td>
            </tr>
            <tr>
                <td>
                    <table>               
                        <tr>
                            <td style="width: 150px"><span class="textoCZ_12">Pessoa:</span></td>
                            <td>
                                <telerik:RadComboBox ID="rcbPessoaEmail" runat="server" Width="400px" 
                                    Height="150px" Skin="Telerik"
			                        EmptyMessage="Selecione um Associado" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
			                        EnableVirtualScrolling="true" OnItemsRequested="rcbPessoaEmail_ItemsRequested"
                                    LoadingMessage="Carregando...">
		                        </telerik:RadComboBox>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="right">
                <br />
                    <asp:Button ID="btnPesquisar" runat="server" Text="Pesquisar" Width="110px" onclick="btnPesquisar_Click" />&nbsp;&nbsp;
                    <asp:Button ID="btnLimpar" runat="server" Text="Limpar" Width="110px" 
                        onclick="btnLimpar_Click" />&nbsp;&nbsp;
                    <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" Width="110px" onclick="btnCancelar_Click" />
                </td>
            </tr>
            <tr runat="server" id="trResultado">
                <td>
                    <table width="100%" align="right">
                        <tr>
                            <td>
                                <div class="SuTituloVR">Resultado da Pesquisa</div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <telerik:RadGrid ID="RadGrid1" Width="100%" Skin="Telerik" 
                                    runat="server" AllowPaging="True" AllowSorting="True"
                                    GridLines="None" AutoGenerateColumns="false" PageSize="20"
                                    onneeddatasource="RadGrid1_NeedDataSource" 
                                    OnItemCommand="RadGrid1_ItemCommand" >
                                    <MasterTableView GridLines="None" DataKeyNames="IdPessoaEmail">
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="Pessoa.NomeCompleto" HeaderText="Pessoa.NomeCompleto" SortExpression="Pessoa.NomeCompleto" UniqueName="Pessoa.NomeCompleto"></telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Email" HeaderText="Email" SortExpression="Email" UniqueName="Email"></telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="TipoEmail.Descricao" HeaderText="TipoEmail.Descricao" SortExpression="TipoEmail.Descricao" UniqueName="TipoEmail.Descricao"></telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Status.Descricao" HeaderText="Status.Descricao" SortExpression="Status.Descricao" UniqueName="Status.Descricao"></telerik:GridBoundColumn>
                                            <telerik:GridButtonColumn CommandName="Select" Text="Selecionar" UniqueName="SelectColumn" />
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                                                   
                            </td>
                        </tr>
                    </table>
                </td>    
            </tr>
        </table>
        
    </form>
</body>
</html>
